package market

import (
	"context"
	"git.900sui.cn/kc/rpcinterface/client"
	"git.900sui.cn/kc/rpcinterface/interface/market"
)

type Share struct {
	client.Baseclient
}

func (s *Share) Init() *Share {
	s.ServiceName = "rpc_market"
	s.ServicePath = "Share"
	return s
}

//营销管理查看共享卡-综合卡、充值卡
func (s *Share) GetCardList(ctx context.Context, args *market.ArgsGetRcardList, reply *market.ReplyGetRcardList) error {
	return s.Call(ctx, "GetCardList", args, reply)
}

//商家共享卡操作-开启关闭
func (s *Share) BusShareOperation(ctx context.Context, args *market.ArgsBusShareOperation, reply *bool) error {
	return s.Call(ctx, "BusShareOperation", args, reply)
}

//共享消费支付成功回调处理
func (s *Share) ConsumePaySuc(ctx context.Context, consumeSn *string, reply *bool) (err error) {
	return s.Call(ctx, "ConsumePaySuc", consumeSn, reply)
}

//获取共享卡信息
func (s *Share) GetShareInfo(ctx context.Context, args market.ArgsGetShareInfo, reply *market.ReplyGetShareInfo) error {
	return s.Call(ctx, "GetShareInfo", args, reply)
}

//用户操作共享卡
func (s *Share) UserShareOperation(ctx context.Context, args market.ArgsUserShareOperation, reply *bool) error {
	return s.Call(ctx, "UserShareOperation", args, reply)
}

//获取共享卡消费码
func (s *Share) GetQrcode(ctx context.Context, relationId int, reply *market.ReplyGetQrcode) error {
	return s.Call(ctx, "GetQrcode", relationId, reply)
}

//获取共享卡消费码
func (s *Share) ShareConsume(ctx context.Context, args market.ArgsShareConsume, reply *market.ReplyShareConsume) error {
	return s.Call(ctx, "ShareConsume", args, reply)
}

//获取用户共享卡列表
func (s *Share) GetUserShareList(ctx context.Context, args market.ArgsGetUserShareList, reply *market.ReplyGetUserShareList) error {
	return s.Call(ctx, "GetUserShareList", args, reply)
}

//获取用户共享明细
func (s *Share) GetUserShareConsumeList(ctx context.Context, args market.ArgsGetUserShareConsumeList, reply *market.ReplyGetUserShareConsumeList) error {
	return s.Call(ctx, "GetUserShareConsumeList", args, reply)
}

//获取用户收益信息
func (s *Share) GetUserIncomeInfo(ctx context.Context, args market.ArgsGetUserIncomeInfo, reply *market.ReplyGetUserIncomeInfo) error {
	return s.Call(ctx, "GetUserIncomeInfo", args, reply)
}

//获取指定的共享卡包的信息
func (s *Share) GetShareCardPackageInfo(ctx context.Context, args *market.ArgsGetShareCardPackageInfo, reply *market.ReplyGetShareCardPackageInfo) error {
	return s.Call(ctx, "GetShareCardPackageInfo", args, reply)
}

//充值卡复充的时候将新的折扣同步更新到对应的共享卡表中
func (s *Share) SyncUpdateRcardDiscountToShareCard(ctx context.Context, args *market.ArgsSyncUpdateRcardDiscountToShareCard, reply *bool) error {
	return s.Call(ctx, "SyncUpdateRcardDiscountToShareCard", args, reply)
}

//卡包状态变更的时候-同步更新营销活动中共享卡的状态
func (s *Share) SyncUpdateShareCardStatus(ctx context.Context, args *market.ArgsSyncUpdateShareCardStatus, reply *bool) error {
	return s.Call(ctx, "SyncUpdateShareCardStatus", args, reply)
}

// 根据shopIds获取最新的综合卡和充值卡-共享卡数据
func (s *Share) GetSingleCardShareCardByShopIds(ctx context.Context, args *market.ArgsGetSingleCardShareCardByShopIds, reply *market.ReplyGetSingleCardShareCardByShopIds) error {
	return s.Call(ctx, "GetSingleCardShareCardByShopIds", args, reply)
}

//获取门店内所有可用的共享卡列表
func (s *Share) GetAllShareCardByShopId(ctx context.Context, args *market.ArgsGetAllShareCardByShopId, reply *market.ReplyGetAllShareCardByShopId) error {
	return s.Call(ctx, "GetAllShareCardByShopId", args, reply)
}

//定时将未支付消费更新为超时
func (s *Share) UpdateOvertimeConsume(ctx context.Context, args string, reply *bool) error {
	return s.Call(ctx, "UpdateOvertimeConsume", args, reply)
}

// 获取共享卡消费记录
func (s *Share) GetShareCardConsumeLogInfo(ctx context.Context, args *market.ArgsGetShareCardConsumeLog, reply *market.ReplyGetShareCardConsumeLog) (err error) {
	return s.Call(ctx, "GetShareCardConsumeLogInfo", args, reply)
}

//共享卡提现
func (s *Share) ShareCardWithdraw(ctx context.Context, args *market.ArgsShareCardWithdraw, reply *bool) (err error) {
	return s.Call(ctx, "ShareCardWithdraw", args, reply)
}

//根据提现订单号更新共享卡提现信息
func (s *Share) UpdateShareCardWithdrawByOrderSnRpc(ctx context.Context, args *market.ArgsUpdateShareCardWithdrawByOrderSn, reply *bool) (err error) {
	return s.Call(ctx, "UpdateShareCardWithdrawByOrderSnRpc", args, reply)
}

//获取所有待提现的提现记录
func (s *Share) GetAllWithdrawingInfoRpc(ctx context.Context, args *market.ArgsGetAllWithdrawingInfo, reply *market.ReplyGetAllWithdrawingInfo) (err error) {
	return s.Call(ctx, "GetAllWithdrawingInfoRpc", args, reply)
}

//根据共享卡消费码获取共享卡列表
func (s *Share) GetShareCardListByCode(ctx context.Context, args *market.ArgsGetShareCardListByCode, reply *market.ReplyGetShareCardListByCode) (err error) {
	return s.Call(ctx, "GetShareCardListByCode", args, reply)
}

//获取共享卡提现记录
func (s *Share) GetShareCardWithdrawList(ctx context.Context, args *market.ArgsGetShareCardWithdrawList, reply *market.ReplyGetShareCardWithdrawList) (err error) {
	return s.Call(ctx, "GetShareCardWithdrawList", args, reply)
}
